// 导入接口文件
import httpInstance from '@/utils/http.js'

/**
 * @description: 获取Banner
 * @param {Object} 参数params是一个对象形式{distributionSite='1'},传字符串1或者2,默认是1
 * @return {*}
*/
export function findBannerAPI(params = {}) {
  // 默认首页为1，内页商品为2
  const {distributionSite = '1'} = params
  return httpInstance({
    url: 'home/banner',
    params: {distributionSite}
  })
}

/**
 * @description: 获取新鲜好物
 * @param {*}
 * @return {*}
*/
export const findNewAPI = () => {
  return httpInstance({
    url: 'home/new'
  })
}

/**
 * @description: 获取人气好物
 * @param {*}
 * @return {*}
*/
export const findHotAPI = () => {
  return httpInstance({
    url: 'home/hot'
  })
}

/**
 * @description: 获取热门品牌
 * @param {*}
 * @return {*}
*/
export const findBrandAPI = () => {
  return httpInstance({
    url: 'home/brand'
  })
}

/**
 * @description: 获取所有商品模块
 * @param {*}
 * @return {*}
*/
export const findGoodsAPI = () => {
  return httpInstance({
    url: 'home/goods'
  })
}